<template>
	<div class="box-container">
		<div class="header-content">
			<span class="font_size20">{{ titleName }}</span>
		</div>
		<div class="body-content mt10">
			<chiceSkuCkModel ref="chiceSkuCkModelRef" :list="gd_ls" :title="`商品`" :type="'goods'"
				@item-change="itemChange">
			</chiceSkuCkModel>
		</div>
		<div class="footer-content">
			<!-- <footer-bottom  v-if="operations.length > 0" :operations="operations" @operation="handleOperation" /> -->
		</div>
	</div>
</template>

<script setup>
import { ref, onMounted, defineProps, defineEmits, getCurrentInstance, watch, computed, nextTick } from '@vue/composition-api'
const { proxy } = getCurrentInstance()
import config from "@/js/conf/Config.js"
import FooterBottom from "@/components/commV2/FooterBottom/index.vue";
import { useOrderReceiptState } from '@/pages/warehouseManage/hooks/useOrderReceiptState.js'
import chiceSkuCkModel from "@/components/commV2/chiceSkuCkModel/index.vue"

const { tabType, detailData, getEventInfo } = useOrderReceiptState()
// into_warehouse  入库单
// out_warehouse  出库单
// transfer_warehouse  调拨单
const titleName = computed(() => {
	return tabType.value == 'into_warehouse' ? '入库单' :
		tabType.value == 'transfer_warehouse' ? '调拨单' :
			tabType.value == 'out_warehouse' ? '出库单' : '未知'
})

// 开单购物车-读取
const cart_info = ref({})
const gd_ls = ref({})
const getCartInfoFun = async () => {
	try {
		let res = await proxy.$api({ url: config.ck_order_cart_info, data: {} })
		if (!res.data) return;
		let result = res.data
		cart_info.value = result
		gd_ls.value = result?.gd_ls
	} catch (error) {
		console.error('开单购物车-读取失败:', error)
	}
}
getCartInfoFun()

onMounted(() => { })

defineExpose({})

</script>

<style lang="scss" scoped>
.box-container {
	height: 100%;
	overflow: hidden;
	display: flex;
	flex-direction: column;

	.header-content {
		width: 100%;
		height: 40px;
		border-bottom: 2px solid #E4E7ED;
		margin-bottom: 5px;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.body-content {
		padding-right: 10px;
		flex: 1;
		overflow: hidden;
		overflow-y: auto;
	}

	.footer-content {
		height: 60px;
	}
}
</style>